const mongoose = require('mongoose');
const dbURL = 'mongodb://localhost:27017/insurance';  // insurance 是数据库的名称
mongoose.connect(dbURL, { useNewUrlParser: true, useUnifiedTopology: true });
// 当数据库连接成功后触发该事件
mongoose.connection.once('open', () => {
  console.log(dbURL + ' 数据库连接成功');
})